"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/11/13 10:05
@Description :  修改数据

"""
import pymysql

# 获取连接对象
connection = pymysql.connect(
    host='localhost',
    port=3306,
    user='root',
    passwd='root',
    db='python2514',
)

# 获取游标对象
cursor = connection.cursor()
str_sql = """
   delete  from user where id = 13
"""
line = cursor.execute(str_sql)
print(line)

# 提交事务   实现数据持久化
connection.commit()

cursor.close()
connection.close()
